package com.bear.controller;

import com.bear.config.HelloServiceAutoConfiguration;
import com.bear.interfacetest.MyLog;
import com.bear.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LiuShanshan
 * @version V1.0
 * @Description
 */
@RestController
@RequestMapping("/hello")
public class HelloController {
    @Autowired
    private HelloServiceAutoConfiguration helloServiceAutoConfiguration;

    @RequestMapping("/hello")
    public String hello(){
        HelloService helloService = helloServiceAutoConfiguration.helloService();
        return helloService.sayHello();
    }

    @RequestMapping("/interfaceAndInterceptor")
    @MyLog(desc = "测试注解 + 拦截器的作用")
    public String interfaceAndInterceptor(){
        HelloService helloService = helloServiceAutoConfiguration.helloService();
        return helloService.sayHello();
    }
}
